<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>

</head>
<body>
	<script>
		function hd(row = 5) {
			//行数
			for (let i =1;i < row;i++){
				for (let c=row-i;c>0;c--){
					console.log(c)
					document.write('<span>&nbsp</span>')
				}
				
				// for (let n=0;n<i;n++){
				// 	document.write('*');
			
				// }
				// for (let m =0;m<i-1;m++){
				// 	document.write('*');
				// }
				for (let m = 2*i-1;m>0;m--){
					document.write('*');
				}
				document.write('</br>')
			}
		}
		hd()
	</script>
</body>
</html>